// 主界面
;
define(function(require, exports, module) {
	'use strict';
	var util = require("util");
	var base = require(CONFIG.BasePath + "js/enterprise/base");
	var router = require("../hash/pageRouter");
	var top = require("../top/top_main");
	var footer = require("../footer/footer_main");
	var newsId;
	var init = function() {
		newsId = base.getUrlParam("newsId");
		inquireNewsDetail();
		router.init();
		initEvent();
	};

	var initEvent = function() {
		//点击首页
		$(".main").on("click", function() {
			location.href = "../main/main.html";
		});
		
		//资讯查询
		$(".search").on("click", function() {
			var keyword = $(this).parent().find(".keyword").val();
			location.href = "./help_main_more.html?keyword=" + encodeURI(encodeURI(keyword));
		});
	};


	//查询资讯列表
	var inquireNewsDetail = function() {
		base.fnAjax({
			action: "inquireNewsDetail.json",
			nocode: true,
			oData: {
				newsId: newsId
			}, //传递参数
			fnSuccess: function(data) {
				if (data.status == 200) {
					var tpl = $("#newsDetailTpl").html();
					var html = juicer(tpl, data);
					$(".newsDetailContent").html(html);
				} else {
					base.alert(3, data.message);
				}
			}
		});
	};

	return {
		init: init
	};
});